package com.suxin.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Tang
 * @classname GoodType
 * @description [  ]
 * @date 2021/4/3 10:06
 */
public enum GoodType implements BaseEnum{

    STUDENT("STUDENT", 0), TEACHER("TEACHER", 1),
    ;

    public static Map<Integer, GoodType> map = new HashMap<>();

    private String name;
    private Integer code;

    GoodType(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    static {
        for (GoodType goodType : GoodType.values()) {
            map.put(goodType.code, goodType);
        }
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return name;
    }
}
